﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/MasterPage.master" AutoEventWireup="true"
    Culture="auto" meta:resourcekey="PageResource1" UICulture="auto" CodeFile="PlaceList.aspx.cs"
    Inherits="SystemManage_PlaceList" Title="地点资料列表" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div class="title">
        <asp:Label ID="lblPageType" runat="server" Text="地点资料列表" meta:resourcekey="lblPageTypeResource1"></asp:Label></div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table class="add_table" cellspacing="1" cellpadding="3" style="width: 70%" align="center">
                <tr>
                    <td align="right">
                       <asp:DropDownList ID="ddlColumnName" runat="server" meta:resourcekey="ddlColumnNameResource1">
                            <asp:ListItem Text="区域" Value="District" meta:resourcekey="ListItemResource3"></asp:ListItem>                         
                              <asp:ListItem Text="地点" Value="Name" meta:resourcekey="ListItemResource6"></asp:ListItem>
                          
                        </asp:DropDownList>
                    </td>
                    <td>
                        <asp:TextBox ID="txtName" runat="server" meta:resourcekey="txtNameResource1"></asp:TextBox>
                    </td>
                    <td align="right">
                        <asp:Label ID="lblSStatus" runat="server" Text="状态：" meta:resourcekey="lblSStatusResource1"></asp:Label>
                    </td>
                    <td>
                        <asp:RadioButton ID="radAll" runat="server" Checked="True" Text="全部" GroupName="Status"
                            meta:resourcekey="radAllResource1" />
                        <asp:RadioButton ID="radYes" runat="server" Text="有效" GroupName="Status" meta:resourcekey="radYesResource1" /><asp:RadioButton
                            ID="radNo" runat="server" Text="无效" GroupName="Status" meta:resourcekey="radNoResource1" />
                    </td>
                    <td align="center">
                        <asp:Button ID="btnSearch" runat="server" Text="搜索" class="btn" OnClick="btnSearch_Click"
                            meta:resourcekey="btnSearchResource1" />
                    </td>
                </tr>
            </table>
            <div class="list_title">
                <div class="autoleft">
                    &nbsp;<asp:Label ID="lblTotal" runat="server" meta:resourcekey="lblTotalResource1"></asp:Label><asp:Label
                        ID="lblRecordFound" runat="server" Text="条记录" meta:resourcekey="lblRecordFound"></asp:Label>&nbsp;&nbsp;&nbsp;<a
                            href="PlaceAdd.aspx"><asp:Label ID="lblPlaceAdd" runat="server" Text="添加地点" meta:resourcekey="lblPlaceAddResource1"></asp:Label></a>&nbsp;<a
                            href="PlaceBatchImport.aspx"><asp:Label ID="lblImport" runat="server" Text="批量导入"
                                meta:resourcekey="lblImportResource1"></asp:Label></a></div>
                <div class="autoright">
                    <asp:Label ID="lblPerPageDisplay" runat="server" Text="每页显示：" meta:resourcekey="lblPerPageDisplay"></asp:Label>
                    <asp:DropDownList ID="ddlPages" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlPages_SelectedIndexChanged"
                        meta:resourcekey="ddlPagesResource1">
                        <asp:ListItem Selected="True" Text="10" Value="10" meta:resourcekey="ListItemResource1"></asp:ListItem>
                        <asp:ListItem Text="15" Value="15" meta:resourcekey="ListItemResource2"></asp:ListItem>
                    </asp:DropDownList>
                </div>
            </div>
            <asp:GridView ID="gvPlaceList" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                Width="100%" OnPageIndexChanging="gvPlaceList_PageIndexChanging" OnRowCommand="gvPlaceList_RowCommand"
                OnSorting="gvPlaceList_Sorting" AllowSorting="True" OnRowDataBound="gvPlaceList_RowDataBound"
                meta:resourcekey="gvPlaceListResource1"  CssClass="tblGridView">
                <PagerTemplate>
                    <table style="width: 100%">
                        <tr>
                            <td>
                                <asp:Label ID="lblCurrentPage" runat="server" Text="页次" meta:resourcekey="lblCurrentPageResource1"></asp:Label>:&nbsp;<asp:Label
                                    ID="Label1" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageIndex+1 %>'
                                    meta:resourcekey="Label1Resource1"></asp:Label>/<asp:Label ID="Label2" runat="server"
                                        Text='<%# ((GridView)Container.Parent.Parent).PageCount %>' meta:resourcekey="Label2Resource1"></asp:Label>&nbsp;
                                <asp:Label ID="lblTotal1" runat="server" Text="总计:" meta:resourcekey="lblTotal1Resource1"></asp:Label>&nbsp;<asp:Label
                                    ID="Label3" runat="server" Text="<%# ((System.Data.DataView)gvPlaceList.DataSource).Count %>"
                                    meta:resourcekey="Label3Resource1"></asp:Label>
                            </td>
                            <td align="right">
                                <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Page" CommandArgument="First"
                                    Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=0 %>" meta:resourcekey="LinkButton1Resource1"
                                    Text="首页"></asp:LinkButton>
                                <asp:LinkButton ID="LinkButton2" runat="server" CommandArgument="Prev" CommandName="Page"
                                    Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=0 %>" meta:resourcekey="LinkButton2Resource1"
                                    Text="前页"></asp:LinkButton>
                                <asp:LinkButton ID="LinkButton3" runat="server" CommandName="Page" CommandArgument="Next"
                                    Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=((GridView)Container.Parent.Parent).PageCount-1 %>"
                                    meta:resourcekey="LinkButton3Resource1" Text="后页"></asp:LinkButton>
                                <asp:LinkButton ID="LinkButton4" runat="server" CommandArgument="Last" CommandName="Page"
                                    Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=((GridView)Container.Parent.Parent).PageCount-1 %>"
                                    meta:resourcekey="LinkButton4Resource1" Text="尾页"></asp:LinkButton>&nbsp;
                                <asp:Label ID="lblTurnOn" runat="server" Text="转第" meta:resourcekey="lblTurnToResource1"></asp:Label>
                                <asp:TextBox ID="txtPages" runat="server" Width="35px" meta:resourcekey="txtPagesResource1"></asp:TextBox>
                                <asp:Label ID="lblPages2" runat="server" Text="页" meta:resourcekey="lblPages2Resource1"></asp:Label>
                                <asp:LinkButton ID="lbtnGo" runat="server" Text="提交" OnClick="lbtnGo_Click" meta:resourcekey="lbtnGoResource1"></asp:LinkButton>
                            </td>
                        </tr>
                    </table>
                </PagerTemplate>
                <Columns>
                    <asp:TemplateField HeaderText="序号" meta:resourcekey="TemplateFieldResourceNum">
                        <ItemTemplate>
                            <asp:Label ID="lblID" runat="server" Text="<%# Container.DataItemIndex   +1%> "></asp:Label>
                        </ItemTemplate>
                        <ItemStyle Width="10%" HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <%-- <asp:TemplateField HeaderText="编号" SortExpression="Code" 
                        meta:resourcekey="TemplateFieldResource1">
                        <ItemTemplate>
                            <asp:Label ID="lblCode" runat="server" Text='<%# Eval("Code") %>' 
                                meta:resourcekey="lblCodeResource1"></asp:Label>
                        </ItemTemplate>
                        <ItemStyle Width="10%" />
                    </asp:TemplateField>--%>
                    <asp:TemplateField HeaderText="区域" SortExpression="District" meta:resourcekey="TemplateFieldResourceDistrict">
                        <ItemTemplate>
                            <asp:Label ID="lblDistrict" runat="server" Text='<%# Eval("District") %>' meta:resourcekey="lblDistrictResource1"></asp:Label>
                            <asp:Label ID="lblHKDistrict" runat="server" Text='<%# Eval("HKDistrict") %>' meta:resourcekey="lblHKDistrictResource1"></asp:Label>
                            <asp:Label ID="lblENDistrict" runat="server" Text='<%# Eval("ENGDistrict") %>' meta:resourcekey="lblENDistrictResource1"></asp:Label>
                        </ItemTemplate>
                        <ItemStyle Width="20%" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="地点" SortExpression="Name" meta:resourcekey="TemplateFieldResource2">
                        <ItemTemplate>
                            <asp:Label ID="lblName" runat="server" Text='<%# Eval("Name") %>' meta:resourcekey="lblNameResource1"></asp:Label>
                            <asp:Label ID="lblHKName" runat="server" Text='<%# Eval("HKName") %>' meta:resourcekey="lblHKNameResource1"></asp:Label>
                            <asp:Label ID="lblENName" runat="server" Text='<%# Eval("ENGName") %>' meta:resourcekey="lblENNameResource1"></asp:Label>
                        </ItemTemplate>
                        <ItemStyle Width="20%" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="状态" SortExpression="Status" meta:resourcekey="TemplateFieldResource3">
                        <ItemTemplate>
                            <asp:Label ID="lblStatus" runat="server" Text='<%# HK2009.Common.StringUtil.GetStatus(Eval("Status")) %>'
                                meta:resourcekey="lblStatusResource1"></asp:Label>
                        </ItemTemplate>
                        <ItemStyle Width="10%" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="备注" SortExpression="Remark" meta:resourcekey="TemplateFieldResource4">
                        <ItemTemplate>
                            <asp:Label ID="lblRemark" runat="server" Text='<%# Eval("Remark") %>' meta:resourcekey="lblRemarkResource1"></asp:Label>
                        </ItemTemplate>
                        <ItemStyle Width="30%" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="操作" meta:resourcekey="TemplateFieldResource5">
                        <ItemTemplate>
                            <a href='PlaceUpdate.aspx?PKID=<%# Eval("PKID") %>'>
                                <asp:Label ID="lblUpdate" runat="server" Text="修改" meta:resourcekey="lblUpdateResource1"></asp:Label></a>
                            <asp:LinkButton ID="lbtnDel" runat="server" Text="删除" CommandArgument='<%# Eval("PKID") %>'
                                meta:resourcekey="lbtnDelResource1" OnClientClick="javascript:return confirm('确定要删除该记录？');"
                                CommandName="Del"></asp:LinkButton>
                        </ItemTemplate>
                        <ItemStyle Width="10%" />
                    </asp:TemplateField>
                </Columns>
                <HeaderStyle HorizontalAlign="Center" />
                <RowStyle HorizontalAlign="Center" />
            </asp:GridView>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
      <br />
    <div>
    <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Export to Excel" CssClass="btn" meta:resourcekey="Button2Resource2" />
    </div>
</asp:Content>
